package org.redmap.controller
{
	import mx.containers.HBox;
	import mx.controls.Label;
	
	import org.redmap.model.IGeometricShape;

	public class MindMapHBox extends MindMapSprite {
		
		public static var counter:int = -1;
		private var textField:Label;
		
		public function MindMapHBox(_id:String=null ,radius:Number=30, color:uint=0xfff000 , label:String=null)
		{
			
			if (_id != null){
		 		//trace("_id im Ball: "+_id);
				counter = parseInt(_id);
				this._id = _id;
				//trace("Counter: "+counter);

			}
			else {
				_id = new Number(++counter).toString();
			}
			
			if (label != null && label.length != 0) {
				this.label = label
			} else {
				label = _id;
			}
			
			textField = new Label();
			
			addChild(textField);
			
			super(_id,radius,color,label);
			this.geometricShape = new HBox() as IGeometricShape;
			
			drawShape();
		}
		
		public override function drawShape():void {
			
			this.graphics.clear();
			
            
            textField.text = label;
            
            this.graphics.lineStyle(1.0, this.color, 1.0);
			this.graphics.beginFill(this.color, 1.0);
			
    	}
		
	}
}